<div class="properties-rows">
	<div class="row"><?php foreach ($projects as $listing) { ?> <?php 
	//get media for listing
	$media = $this->mdl_projectsmodel->get_media_v2($listing['ID'], "Cover,Gallery", 1);
	if(isset($media->FileName) && isset($media->FileExtension)) {
		//$image = $this->imagemodel->resize($media->FileName . $media->FileExtension, IMAGE_WIDTH, IMAGE_HEIGHT, HTTP_PROJECT_DIRECTORY_IMAGE . $listing['ID'] . '/', $this->config->item('HTTP_PRODIR_MEDIA_IMAGE') . $listing['ID'] . '/');
		$image = $this->config->item('HTTP_PRODIR_MEDIA_IMAGE') . $listing['ID'] . '/' . $media->FileName . '-270x200' . $media->FileExtension;
	} else {
		$image = $this->config->item('HTTP_IMAGE') . 'tmp/no-image.png';
	}
	?>
	<div class="property span9">
			<div class="row">
				<div class="image span3">
					<div class="content">
						<?php if($media) { ?> 
						<a href="project-detail/<?php echo $listing['Link']; ?>"><img src="<?php echo $image; ?>" alt=""></a> 
						<?php } else { ?> 
						<img src="<?php echo $this->config->item('HTTP_IMAGE'); ?>tmp/no-image.png" alt=""> 
						<?php } ?>
					</div>
					<!-- /.content -->
				</div>
				<!-- /.image -->
				<div class="body span6">
					<div class="title-price row">
						<div class="title span4">
						<h2><a href="project-detail/<?php echo $listing['Link']; ?>"><?php echo $listing['ProjectName']; ?></a></h2>
						</div>
						<!-- /.title -->
					
						<!-- <div class="price"><?php //echo $listing['PropertyType']; ?>
						</div> -->
						<!-- /.price -->
					</div>
						<!-- /.title -->
					<div class="w-box-content-3 cnt_a property-detail">
						<div class="location"><?php
						//Locality
						//initiation
						$locality = "";
						//check subarea
						if (!empty($listing['Subarea'])) {
							$locality .= $listing['Subarea'] . ", ";
						}
						
						//check location
						if (!empty($listing['Location'])) {
							$locality .= $listing['Location'] . ", ";
						}
						
						//check city
						if (!empty($listing['City'])) {
							$locality .= $listing['City'];
						}
						
						if (!empty($locality)) {
							echo $locality;
						}
						?></div>
						<!-- /.location -->
						<div class="description">
							<p><?php echo html_entity_decode(character_limiter($listing['Description'], 100) , ENT_QUOTES, 'UTF-8'); ?>
							</p>
						</div>
						<div class="area"><span class="key">Area from</span><!-- /.key --> <span
							class="value"><?php echo number_format($listing['Size_Min']) . ' ' . $listing['SizeUnit']; ?></span><!-- /.value -->
						<span class="key">to</span><!-- /.key --> <span class="value"><?php echo number_format($listing['Size_Max']). ' ' . $listing['SizeUnit']; ?></span><!-- /.value -->
						</div>
						<!-- /.area -->
					</div>
				</div>
				<!-- /.body -->
			</div>
			<!-- /.property -->
		</div>
	<!-- /.row --> <?php } ?>
	</div>
<!-- /.row -->
</div>
<!-- /.properties-rows -->
